<?php
     @header("Content-Type:text/html;charset=utf-8");
     $connect=mysqli_connect("localhost","root","root","2101");
     if($connect){

     }else{
         exit("数据库连接失败");
     }
     mysqli_query($connect,"set names utf8");
     mysqli_query($connect,"set character set utf-8");

     $user=$_GET['user'];
     $pwd=$_GET['pwd'];

     $sqlstr="select * from `regi` where user='$user' or pwd='$pwd'";
     $querystr=mysqli_query($connect,$sqlstr);
     $result=mysqli_fetch_assoc($querystr);
     $arr=array();
     if($result){
        $arr["status"]=true;
        $arr["detail"]="登录成功";
        echo json_encode($arr);
     }else{
        $arr["status"]=false;
        $arr["detail"]="用户不存在";
        echo json_encode($arr);
     }

?>